package cn.rkylin.oms.base.returnReasonType.service;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageInfo;

import cn.rkylin.core.ApolloMap;
import cn.rkylin.core.service.ApolloService;
import cn.rkylin.oms.base.returnReasonType.dao.IReturnReasonTypeDAO;
import cn.rkylin.oms.base.returnReasonType.domain.ReturnReasonType;
import cn.rkylin.oms.base.returnReasonType.vo.ReturnReasonTypeVO;

/**
 * 退货原因类型服务实现
 * 
 * @author qitao
 * @version 1.0
 * @created 17-7月-2017
 */
@Service
public class ReturnReasonTypeService extends ApolloService {

    @Autowired
    private IReturnReasonTypeDAO rdfundReasonTypeDAO;

    /**
     * 查询退货原因类型
     * 
     * @param page 页号
     * @param rows 页大小
     * @param ReturnReasonTypeVO 退货原因类型VO
     */
    public PageInfo<ReturnReasonTypeVO> findByWhere(int page, int rows, ReturnReasonTypeVO rdfundReasonTypeVO) throws Exception {
        PageInfo<ReturnReasonTypeVO> rdfundReasonTypeVOList = findPage(page, rows, "pageSelectReturnReasonType", rdfundReasonTypeVO);
        return rdfundReasonTypeVOList;
    }

    /**
     * 查询退货原因类型根据退货原因编码
     * 
     * @param params 数据参数
     */
    public int getReturnReasonTypeCountByCode(Map<String, Object> params) throws Exception {
        return rdfundReasonTypeDAO.getReturnReasonTypeCountByCode(params);
    }

    /**
     * 插入退货原因类型
     * 
     * @param params 数据参数
     */
    public int insertReturnReasonType(ApolloMap<String, Object> params) throws Exception {
        return rdfundReasonTypeDAO.insertReturnReasonType(params);
    }

    /**
     * 查询退货原因类型
     * 
     * @param params 数据参数
     */
    public ReturnReasonType getReturnReasonTypeInfo(Map<String, Object> params) throws Exception {
        return rdfundReasonTypeDAO.getReturnReasonTypeInfo(params);
    }

    /**
     * 修改退货原因类型
     * 
     * @param params 数据参数
     */
    public int updateReturnReasonType(ApolloMap<String, Object> params) throws Exception {
        return rdfundReasonTypeDAO.updateReturnReasonType(params);
    }

    /**
     * 删除退货原因类型
     * 
     * @param params 数据参数
     */
    public int deleteReturnReasonType(ApolloMap<String, Object> params) throws Exception {
        return rdfundReasonTypeDAO.deleteReturnReasonType(params);
    }

}
